<template>
  <div class="bob-card">
    <!-- 列表页 card -->
    <div class="title">
      <div class="left">
        {{ title }}
      </div>
      <div class="right" v-if="rightTitle" @click="rightBtn">
        {{ rightTitle }}
      </div>
    </div>
    <div class="content">
      <slot />
    </div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  title: String,
  rightTitle: String,
});
const emit = defineEmits(["click"]);
const rightBtn = () => {
  emit("click");
};
</script>

<style lang="scss" scoped>
.bob-card {
  background-color: white;
  padding: 16px;
  .title {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    font-size: 16px;
    color: #1d2129;
    margin-bottom: 16px;
    .right {
      width: 80px;
      height: 28px;
      background: #ffffff;
      border-radius: 14px 14px 14px 14px;
      border: 1px solid var(--van-primary-color);
      text-align: center;
      font-weight: 600;
      font-size: 14px;
      color: var(--van-primary-color);
      line-height: 28px;
    }
  }
  .content {
    font-size: 15px;
  }
}
</style>

